package com.mo.modular.tv.job;

import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
@EnableScheduling
public class SchedulerQuartzJob {

	
	private Logger log = LoggerFactory.getLogger(this.getClass());
	
	@Scheduled(cron="${baseInfo.job.deleteExpiredContCron}")
	public void deleteExpiredCont(){
		log.info("*********批量解绑过期资产开始，当前时间为"+new Date()+"*********");
		try{
//			//查询过期的栏目绑定解绑，资产状态置为禁用
//			menuService.deleteExpiredMenu();
//			//查询过期的视频绑定解绑，资产状态置为禁用
//			contService.deleteExpiredZlCont();	
		}catch(Exception e){
			log.info("*********批量解绑过期资产失败，失败原因为："+e.getMessage());
			e.printStackTrace();
		}finally{
			log.info("*********批量解绑过期资产结束，当前时间为"+new Date()+"*********");
		}
	}
	
	@Scheduled(cron="${baseInfo.job.collectContPlayCountCron}")
	public void collectContPlayCount(){
		log.info("*********收集资产播放次数开始，当前时间为"+new Date()+"*********");
		try{
//			contService.collectContPlayCount();
		}catch(Exception e){
			log.info("*********收集资产播放次数开始失败，失败原因为："+e.getMessage());
			e.printStackTrace();
		}finally{
			log.info("*********收集资产播放次数开始结束，当前时间为"+new Date()+"*********");
		}
	}

}

